package mo.tags.greedy;

public class L769 {

    public int maxChunksToSorted(int[] arr) {
        int m = 0, size = 0;
        for (int i = 0; i < arr.length; i++) {
            m = Math.max(m, arr[i]);
            if (m == i) {
                size++;
            }
        }
        return size;
    }

}
